<?php
require_once 'config/config.php';
require_once("db/dbconnect.class.php");
$db = new Connection();
require_once 'users/userAccess.class.php';
// ----------------------------------------------
//  include SESSION file
// ----------------------------------------------    
 	require_once 'core/sessions.class.php';
 	$SESS= new Session(); 
 	
 	
$userAccess = new UserAccess();
 	
$userAccess->isLoggedIn(10);




function deleteUser( $id ,$db){


	
		$sql = "DELETE FROM `user_login` WHERE `id` = ".$id.";";
 		$result = $db->selectQuery($sql);
 		
 		if ($result){
 		
 		$sql = "DELETE FROM `user_profile` WHERE `loginId` = ".$id.";";
 		$result = $db->selectQuery($sql);
 		
 		}
 		
 		
 		
 		if ($result){
 		header("Location:users.php");
 		}
}




deleteUser($_GET['id'], $db);


	?>